<%--
    Document   : changePassword
    Created on : 11 Mar, 2012, 11:07:38 PM
    Author     : Akil Mahimwala
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="../common/script.jsp" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="../common/title.jsp"%>
        <script>
            function checkPassword() {
                if (document.getElementById("newPassword").value!=document.getElementById("confirmPassword").value || document.getElementById("newPassword").value=="") {
                    alert ("<spring:message code="msg.passwordMatch"/>");
                    return false;
                } else {
                    return true;
                }
            }
        </script>
    </head>
    <body>
        <%@include file="../common/header.jsp" %>
        <%@include file="../common/menu.jsp" %>
        <div class="in_02">
            <%@include file="../common/message.jsp" %>

            <form:form name="form1" commandName="password" method="POST" onsubmit="return checkPassword();">
                <fieldset>
                    <legend><spring:message code="title.updatePassword"/></legend>
                    <br/>
                    &nbsp;&nbsp;&nbsp;&nbsp;Change Password For User: 
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${password.username}(${password.userId})<br/><br/>
                    <table class="formTable">
                        
                        <tr>
                            <td><spring:message code="oldPassword"/>:<br/> <form:password path="oldPassword" class="userInputLarge"/></td>
                            <td><spring:message code="newPassword"/>:<br/> <form:password path="newPassword" class="userInputLarge"/></td>
                        </tr>
                        <tr>
                            <td><spring:message code="confirmNewPassword"/>:<br/> <input type="password" id="confirmPassword" class="userInputLarge"/></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td><input type="button" name="btnCancel" value="<spring:message code="button.Cancel"/>" onclick="location.href='../home/index.htm'" /></td>
                            <td><input type="submit" name="btnSubmit" value="<spring:message code="button.Update"/>"/></td>
                        </tr>

                    </table>

                    <spring:hasBindErrors name="password">
                        <div class="error">
                            <form:errors path="*"/>
                        </div>
                    </spring:hasBindErrors>
                </fieldset>
            </form:form>
        </div>
    </body>
</html>
